package com.study.springboottest.sort;

import java.util.ArrayList;
import java.util.List;

public class SortTest {

    public static void main(String[] args) {
        List<Student> studentList = new ArrayList<>();
        Student student = new Student();
        student.setId("1");
        student.setName("1");
        student.setAge(1);
        student.setScore(10.0);
        Student student1 = new Student();
        student1.setId("1");
        student1.setName("1");
        student1.setAge(1);
        student1.setScore(11.0);
        studentList.add(student);
        studentList.add(student1);
        studentList.sort((s1, s2) -> Double.compare(s2.getScore(), s1.getScore()));
    }
}
